package cn.sykj.car.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * 菜单
 * </p>
 *
 * @author yixu
 * @since 2018-12-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = false)
@TableName("menu")
@ApiModel(value="Menu对象", description="菜单")
public class Menu extends Model<Menu> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "菜单名")
    private String title;

    @ApiModelProperty(value = "URL")
    private String path;

    @ApiModelProperty(value = "path_name")
    private String name;

    @ApiModelProperty(value = "父级重定向url")
    private String redirect;

    @ApiModelProperty(value = "文件路径")
    private String component;

    @ApiModelProperty(value = "图标")
    private String icon;

    @ApiModelProperty(value = "父ID")
    private Integer pid;

    @ApiModelProperty(value = "菜单排序")
    private Integer sorted;

    @ApiModelProperty(value = "业务controller名【三级菜单必填】")
    private String controllerName;


    public static final String ID = "id";

    public static final String TITLE = "title";

    public static final String PATH = "path";

    public static final String NAME = "name";

    public static final String REDIRECT = "redirect";

    public static final String COMPONENT = "component";

    public static final String ICON = "icon";

    public static final String PID = "pid";

    public static final String SORTED = "sorted";

    public static final String CONTROLLER_NAME = "controller_name";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
